from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader, RequestContext
from overview.models import ModelDataOverview
from django.db.models import F, Q


def index(request):
    """索引界面"""
    return render(request, "index.html")


def null_check(request):
    """
    空值检测
    """
    data_overview_list = ModelDataOverview.objects.all()

    print(data_overview_list)
    for i in data_overview_list:
        print(i)

    # print(ModelDataOverview.objects.get(id=1))
    # print(data_overview_list.objects.filter(name__contains="雪山"))
    # print(data_overview_list.objects.filter(name__endswith="八部"))
    # print(data_overview_list.objects.filter(name__isnull=False))
    # print(data_overview_list.objects.filter(name__in=['学习']))
    # print(data_overview_list.objects.filter(id__gt=1))

    # author_list = ModelDataOverview.objects.all().order_by('id')

    return render(request, "overview/null-check.html", {'data_overview_list': data_overview_list})
